package cn.initcap.controller;

import cn.initcap.common.JsonData;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author initcap
 * @date Created in 2018/5/17 PM3:04.
 */
@RestController
public class HelloController {

    @GetMapping("/me")
    public JsonData me(Authentication authentication) {
        //return JsonData.success(SecurityContextHolder.getContext().getAuthentication());
        return JsonData.success(authentication);
    }

    @GetMapping("/hello")
    public String hello() {
        return "hello word";
    }
}
